/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package web;

import entities.Item;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;

/**
 *
 * @author Alejandro
 */
@ManagedBean
@RequestScoped
public class ItemManagedBean {

    public ItemManagedBean() {
    }

    public String viewItem() {

        Item item = (Item) FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get("item");
        FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(Constants.NEXT_VIEW, Constants.ITEM + Constants.SEPARATOR + item.getIdItem());
        FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(Constants.EXTRA1, item);
        return "UPDATE";
    }
}
